import java.util.ArrayList;
import java.util.HashMap;
public class    Main {
    public static void main(String[] args){
        ArrayList<String> arrayList = new ArrayList<>();
        System.out.println("集合的长度："+ arrayList.size());
        arrayList.add("123");
        arrayList.add("456");
        arrayList.add("789");
        arrayList.add("123");
        arrayList.add("456");
        arrayList.add("789");
        System.out.println("集合的长度："+arrayList.size());
       arrayList.remove(3);
        System.out.println("第五个元素的值："+arrayList.get(4));
        for(int i =  0;i<arrayList.size();i++){
            System.out.println(arrayList.get(i));

            HashMap<String,String>hashMap = new HashMap<>();
            hashMap.put("key1","value1");
            hashMap.put("key2","value2");
            hashMap.put("key3","value3");
            hashMap.put("key4","value4");

            hashMap.remove("key3");
            hashMap.put("key","这是被修改过后的key4");
            System.out.println(hashMap.get("key4"));
            for (String key : hashMap.keySet()){
               System.out.println("key是："+key +"1 Value是："+hashMap.get(key));
            }
        }
    }
}

